<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org"
	xmlns:dt="http://github.com/dandelion/datatables"
	xmlns:sec="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<title>Edit Use Case</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Dhrubo" />




</head>

<body>
	<div th:each="f, stat : ${useCase.mainFlow.steps}" th:fragment="alternate">
		<div class="row-fluid" th:each="s , statinner : ${f.alternates}"
			th:unless="${#lists.isEmpty(f.alternates)}">

			<div class="span12">
				<table class="alternate">
					<thead>
						<tr>
							<th colspan="3"><div
									th:id="'alt'+${stat.index}+${statinner.index}"
									th:name="'alt'+${stat.index}+${statinner.index}"
									th:text="'Alternate Flow - ' + ${stat.count} + '.' + ${statinner.count}"></div>
							</th>
						</tr>

						<tr>
							<th colspan="3">

								<form action="addalternateflowstep">

									<input type="hidden" name="id" th:value="${useCase.id}" /> <input
										type="hidden" name="stepid" th:value="${stat.index}" /> <input
										type="hidden" name="flowid" th:value="${statinner.index}" />

									<div class="input-append span10">
										<input class="input span12" id="description" type="text"
											placeholder="Description" name="description" />
										<button class="btn btn-success" type="submit">Save</button>
									</div>

								</form>
							</th>

						</tr>

						<tr>
							<th style="width: 5%">Step</th>

							<th>Definition</th>
							<th style="width: 3%">Action</th>
						</tr>


					</thead>
					<tbody>


						<tr th:each="k, rowStat : ${s.steps}">
							<td style="width: 5%" th:text="${rowStat.count}">1</td>
							<td class="editable"><a href="#"
								th:attr="data-pk=${useCase.id}, data-name=${rowStat.index}"
								th:text="${k.description}">Mike</a></td>

							<td>

								<div class="btn-group pull-right">
									<a th:unless="${rowStat.index == 0}"
										th:href="@{/moveupalternate(usecase=${useCase.id}, index=${rowStat.index}, stepid=${stat.index}, flowid=${statinner.index})}"
										class="btn btn-primary"> <i
										class="icon-arrow-up icon-white" title="Move up"></i>
									</a> <a th:unless="${rowStat.count eq rowStat.size}"
										th:href="@{/movedownalternate(usecase=${useCase.id}, index=${rowStat.index}, stepid=${stat.index}, flowid=${statinner.index})}"
										class="btn btn-primary"> <i
										class="icon-arrow-down icon-white" title="Move down"></i>
									</a> <a
										th:href="@{/deletestepalternate(usecase=${useCase.id}, index=${rowStat.index}, stepid=${stat.index}, flowid=${statinner.index})}"
										class="btn btn-danger"> <i
										class="icon-remove-sign icon-white" title="Delete"></i>
									</a>
								</div>

							</td>
						</tr>

					</tbody>
				</table>
			</div>
		</div>

	</div>


</body>
</html>
